package com.cloudlead.forwardAction.action;
import com.cloudlead.common.lang.BusinessModule;
import com.cloudlead.common.lang.annotation.Label;
import com.cloudlead.common.lang.persistence.EasyuiGridData;
import com.cloudlead.common.lang.persistence.Page;
import com.cloudlead.common.worker.action.impl.AbstractActionFactory;
import com.cloudlead.common.worker.annotation.Action;
import com.cloudlead.common.worker.annotation.Order;
import com.cloudlead.forwardAction.BusinessModules;
import com.cloudlead.forwardAction.service.ShipRouteSer;
import com.cloudlead.forwardService.ShipRouteService;
import com.cloudlead.forwardService.vo.BaseShipRoute1Vo;
import com.cloudlead.forwardService.vo.BaseShipRouteVo;
import com.cloudlead.forwardService.vo.EaseUiVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * Created by Administrator on 2015/8/20.
 */
@Controller
public class ShipRouteAcitonFactory extends AbstractActionFactory implements ShipRouteService {
    @Autowired
    ShipRouteSer shipRouteSer;
    public ShipRouteAcitonFactory() {super(BusinessModules.ShipRouteManagement);}

    @Override
    @Action
    @Order(1)
    @Label("航线创建")
    public void addShipRoute(BaseShipRoute1Vo baseShipRoute1Vo) {
        shipRouteSer.addShipRoute(baseShipRoute1Vo);
    }

    @Override
    @Action
    @Order(2)
    @Label("航线单值查询")
    public BaseShipRouteVo findOneShipRoute(BaseShipRouteVo baseShipRouteVo) {
        return shipRouteSer.findOneShipRoute(baseShipRouteVo);
    }

    @Override
    @Action
    @Order(3)
    @Label("航线分页查询")
    public EasyuiGridData findShipRoute(@Label("查询条件添加")BaseShipRouteVo vo) {
        return new EasyuiGridData(shipRouteSer.findShipRoute(vo),"id");
    }

    @Override
    @Action
    @Order(4)
    @Label("航线删除")
    public void delShipRoute(String id) {
        shipRouteSer.delShipRoute(id);
    }

    @Override
    @Action
    @Order(5)
    @Label("测试")
    public EaseUiVo testEasyUi(@Label("页数")Integer page,@Label("条数")Integer rows) {
        return shipRouteSer.testEasyUi(page,rows);
    }



/*
    @Action
    @Order(5)
    @Label("测试2")
    public EaseUiVo testEasyUi2(BaseFleetVo baseFleetVo ,@Label("页数")Integer page,@Label("条数")Integer rows) {
        return shipRouteSer.findAllFleetEasyUI(baseFleetVo,page, rows);
    }*/
}
